home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / telecomm / uwsrc.arc / WINDEFS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-04-29  |  4.3 KB  |  157 lines

  1. /* header file with various definitions
  2.  */
  3.  
  4. /* this one should really be in stdio.h ...
  5.  */
  6.  
  7. #ifndef NULL
  8. #define NULL ((char *) 0)
  9. #endif
  10.  
  11. #define TRUE 1
  12. #define FALSE 0
  13.  
  14. /* constants
  15.  */
  16.  
  17. #define ALTINDICATOR '\05'
  18. #define MAXFUNCLEN 41  /* Maximum length of function key string */
  19. #define BREAK_TICKS 20 /* length of break in clock() ticks (5ms * 20 = .1s) */
  20. #define MAXSCROLLED 8
  21. #define MAX_WIND 8
  22. #define NFSTRINGS 42            /* number of function keys */
  23. #define WI_WITHSLD (SIZER|UPARROW|DNARROW|VSLIDE|LFARROW|RTARROW|HSLIDE)
  24. #define WI_NOSLD (NAME|MOVER|CLOSER|FULLER)
  25.  
  26.  
  27. #define WI_ROWS 80
  28. #define WI_LINES 24
  29. #define WI_WCHAR 8
  30. #define WI_HCHAR 16
  31. #define WI_WPIX (WI_ROWS*WI_WCHAR+16)
  32. #define WI_WWORDS ((WI_WPIX+15)/16)
  33. #define WI_HPIX (WI_LINES*WI_HCHAR)
  34. #define WI_SIZE ((long)WI_WWORDS*WI_HPIX*2)
  35. #define XON '\021'
  36. #define XOFF '\023'
  37.  
  38. #define xmitcmd(x)    { Bconout(1, IAC); Bconout(1, CB_DIR_MTOH|x); }
  39.  
  40. #define MINMAX(x, y, z) ( x<y ? y : (x>z ? z :x) )
  41.  
  42. #define HASHBITS 9        /* number of bits of hash for character lookup*/
  43.  
  44. #define FM_INVERT 12        /* logic parameter to copy_fm */
  45. #define FM_COPY    3        /* copy source to dest    */
  46.  
  47. #define X0 1
  48. #define Y0 1
  49.  
  50. /* emulation FSM states
  51.  */
  52.  
  53. #define S_NORMAL    0
  54. #define S_ESC        1
  55. #define S_ESC1        2
  56. #define S_ESC2        3
  57. #define S_ESC3        4
  58. #define S_STATUS    5
  59. #define S_ESCA        6
  60.  
  61. #define min(a,b) ( a < b ? a : b )
  62. #define max(a,b) ( a > b ? a : b )
  63. /* data types used
  64.  */
  65.  
  66. typedef struct mfdb {
  67.   short *ptr;            /* ptr to memory holding the image */
  68.   short wpix;            /* width in pixels */
  69.   short hpix;            /* height in pixels */
  70.   short wwords;            /* width in words */
  71.   short format;            /* 0 for machine-dependent */
  72.   short planes;            /* 1 for hires screen */
  73. } MFDB;
  74.  
  75. typedef struct {
  76.   unsigned char h_t[1<<HASHBITS];    /* hash table */
  77.   struct {
  78.     char h_try;                /* try this character next */
  79.     char h_next;            /* index of next entry in table */
  80.   } h_colision[128];            /* colision lists formed here */
  81. } HTBL;
  82.  
  83. typedef struct fnt {
  84.   int inc_x, inc_y;        /* real size of one char */
  85.   int def_win_x, def_win_y;    /* default window size in chars for this font */
  86.   HTBL f_hash;            /* hash table for this font */
  87.   char f_data[2048];        /* character data */
  88. } FNT;
  89.  
  90. typedef struct wi_str {
  91.   int port;            /* the UW port identifier */
  92.   int fulled,used;        /* flags */
  93.   int inverse;            /* inverse chars */
  94.   int insmode;            /* insert mode on */
  95.   int curstate;            /* state of the cursor */
  96.   int x, y, w, h;        /* work area on screen */
  97.   int px, py, pw, ph;        /* previous location of entire window */
  98.   int x_off, y_off;        /* offset for visible part */
  99.   int px_off, py_off;        /* previous offset */
  100.   int m_off;            /* memory offset */
  101.   int wi_w, wi_h;        /* max w,h */
  102.   int cur_x, cur_y;        /* current cursor position */
  103.   int top_y;            /* position of top of circular window buffer */
  104.   int state;            /* state for the emulation FSM */
  105.   FNT *font;            /* the font in use */
  106.   MFDB wi_mf;            /* memory form for this window */
  107.   char name[80];        /* name of this window */
  108.   char nuname[80];        /* new name under construction */
  109.   char dname[80];        /* name actually displayed (w/ flags, etc.) */
  110.                 /* (dname is set in w_rename) */
  111.   int nuptr;            /* curr. len of new name or parameter assembly*/
  112.   int ptr_status;        /* status of print loging for window */
  113.   int x_chrs, y_chrs;        /* size of terminal emulation */
  114.   int top_age;            /* number of windows topped after this window */
  115.   int wi_style;            /* style of window (see WI_*SLD) */
  116.   char wi_fpath[80];        /* log file path */
  117.   char wi_fname[20];        /* log file name */
  118.   FILE *wi_lfd;            /* log file descriptor */
  119.   int kerm_act;            /* is this a kermit window? */
  120.   int w_local;            /* is this a local window? */
  121. } WI_STR;
  122.  
  123. #define LOG_BOTOM    1    /* print incoming characters */
  124. #define LOG_TOP        2    /* print lines which scroll off screen top */
  125. #define LOG_NONE    0    /* no printer output for this window */
  126.  
  127. typedef struct gemfont {
  128.     short    ft_id;
  129.     short    ft_psize;
  130.     char    ft_name[32];
  131.     short    ft_l_ade;
  132.     short    ft_h_ade;
  133.     short    ft_topl;
  134.     short    ft_ascl;
  135.     short    ft_halfl;
  136.     short    ft_descl;
  137.     short    ft_botl;
  138.     short    ft_chwidth;
  139.     short    ft_clwidth;
  140.     short    ft_lf_off;
  141.     short    ft_rt_off;
  142.     short    ft_thick;
  143.     short    ft_ul;
  144.     short    ft_light;
  145.     short    ft_skew;
  146.     short    ft_flags;
  147.     short    *ft_h_off;
  148.     short    *ft_c_off;
  149.     short    *ft_data;
  150.     short    ft_fwidth;
  151.     short    ft_fheight;
  152.     struct gemfont *ft_next;
  153. } GEMFONT;
  154.  
  155. typedef char FUNCSTRING[MAXFUNCLEN];
  156.  
  157.